Inside Macintosh: Macintosh Toolbox Essentials

Previous | Chapter Top | Chapter Contents | Next

The Window Record

If Color QuickDraw is not available, you create windows with a parallel data structure, the window record. The only difference between a color window record and a window record is that a color window record points to a color graphics port, which allows full use of Macintosh computers with color capability, and a window record points to a monochrome graphics port

The data types that describe window records, WindowRecord , WindowPtr , and WindowPeek , are parallel to the data types that describe color window records, and the fields in the monochrome window record are identical to the fields in the color window record. For a complete description, see "The Color Window Record" .

struct WindowRecord {                   /* all fields have same use
                                        /* as in color window record */
    GrafPort            port;           /*window's graphics port */
    short               windowKind;     /*class of the window */
    Boolean             visible;        /* visibility */
    Boolean             hilited;        /* highlighting */
    Boolean             goAwayFlag;     /* presence of close box */
    Boolean             spareFlag;      /* presence of zoom box */
    RgnHandle           strucRgn;       /* handle to structure
                                        /* region */
    RgnHandle           contRgn;        /* handle to content
                                        /* region */
    RgnHandle           updateRgn;      /* handle to update region */
    Handle              windowDefProc;  /* handle to window
                                        /* definition function */
    Handle              dataHandle;     / *handle to window state
                                        /* data record */
    StringHandle        titleHandle;    /* handle to window title */
    short               titleWidth;     /* title width in pixels */
    ControlHandle       controlList;    /* handle to window's
                                        /* control list */
    WindowPeek          nextWindow;     /* next window in window
                                        /* list */
    PicHandle           windowPic;      /*handle to optional
                                        /* picture */
    long                refCon;         /*reference constant */
};
typedef struct WindowRecord WindowRecord;
typedef WindowRecord *WindowPeek;
typedef GrafPtr WindowPtr;

© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next